Skip to main content

mobileSensorReading

Type

function

Summary

Returns the reading from the named sensor.

Syntax

mobileSensorReading(<sensor>, <detailed>)

Description

Use the mobileSensorReading function to fetch a reading from the named device sensor.

The mobileSensorReading function returns a reading from the named sensor.

note

When speed is returned, the value is in meters per second. To convert to miles per hour, multiply the value by 2.237. To convert to kilometers per hour, multiply it by 3.6 instead.

Parameters

NameTypeDescription

sensor

enum

The name of the sensor you wish to start using

detailed

enum

How detailed the readings from sensors should be. The default value is false

Examples

get mobileSensorReading("heading",false)
put mobileSensorReading("location",true) into tDeviceLocation

command: mobileStopTrackingSensor, mobileStartTrackingSensor

function: mobileCanTrackHeading, mobileCanTrackLocation, mobileCurrentHeading, mobileCurrentLocation

message: headingChanged, accelerationChanged, locationChanged, rotationRateChanged, trackingError

Compatibility and Support

Introduced

LiveCode 5.5

OS

ios

android

Platforms

mobile

Thank you for your feedback!

Was this page helpful?